package com.xuecheng.media.service;

import com.aliyuncs.exceptions.ClientException;
import com.xuecheng.commons.model.dto.MediaDto;
import com.xuecheng.commons.model.dto.MediaQueryDto;
import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.dto.VodUploadDto;
import com.xuecheng.commons.model.vo.MediaVo;
import com.xuecheng.commons.model.vo.ResourceVo;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.commons.model.vo.VodUploadVo;
import com.xuecheng.media.domain.Media;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 媒资信息 服务类
 * </p>
 *
 * @author itheima
 * @since 2022-09-22
 */
public interface MediaService extends IService<Media> {

    //获取上传凭证
    ResponseResult<VodUploadVo> createToken(VodUploadDto dto) throws ClientException;

    //刷新上传凭证
    ResponseResult<VodUploadVo> refreshToken(String videoId) throws Exception;

    //保存
    ResponseResult saveMedia(MediaDto dto) throws Exception;

    //分页查询媒资列表
    ResponseResult<MediaVo> findAll(PageRequest request, MediaQueryDto dto);

    //根据id查询媒资的播放地址
    ResponseResult<ResourceVo> findMediaUrl(Long mediaId) throws Exception;
}
